package com.huawei.codearts;

import com.huawei.codearts.listener.EtcdWatchApplicationListener;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;

@SpringBootApplication
@EnableAsync  // 启动类开启对Async异步的支持 @EnableAsync
//@ComponentScan(basePackages={"com.huawei.codearts"})  // 注解式监听一个新线程
@MapperScan("com.huawei.codearts.mapper")
public class JavaWebSpringApplication {

	public static void main(String[] args) {
//		SpringApplication.run(JavaWebSpringApplication.class, args);
		SpringApplication app = new SpringApplication(JavaWebSpringApplication.class);
//		app.addListeners(new EtcdWatchApplicationListener());  // 监听一个新线程
		app.run(args);
	}
}
